

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Introduction &mdash; CVX Users&#39; Guide</title>
    
    <link rel="stylesheet" href="_static/cloud.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noticia+Text|Open+Sans|Droid+Sans+Mono" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    <script type="text/javascript" src="_static/jquery.cookie.js"></script>
    <script type="text/javascript" src="_static/cloud.js"></script>
    <link rel="top" title="CVX Users&#39; Guide" href="index.html" />
    <link rel="next" title="Installation" href="install.html" />
    <link rel="prev" title="CVX Users’ Guide" href="index.html" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <div class="relbar-top">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="install.html" title="Installation"
             accesskey="N">next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="index.html" title="CVX Users’ Guide"
             accesskey="P">previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &raquo;</li>
 
      </ul>
    </div>
    </div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="introduction">
<span id="id1"></span><h1>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline">¶</a></h1>
<div class="section" id="what-is-cvx">
<h2>What is CVX?<a class="headerlink" href="#what-is-cvx" title="Permalink to this headline">¶</a></h2>
<span class="target" id="index-0"></span><p id="index-1">CVX is a modeling system for constructing and solving
<a class="reference internal" href="#what-is-dcp"><em>disciplined convex programs</em></a> (DCPs).
CVX supports a number of standard problem types, including linear and
quadratic programs (LPs/QPs), second-order cone programs (SOCPs), and
semidefinite programs (SDPs). CVX can also solve much more complex convex
optimization problems, including many involving nondifferentiable
functions, such as <span class="math">\(\ell_1\)</span> norms. You can use CVX to conveniently
formulate and solve constrained norm minimization, entropy maximization,
determinant maximization, and many other convex programs. As of version
2.0, CVX also solves <a class="reference internal" href="#what-is-midcp"><em>mixed integer disciplined convex programs</em></a> (MIDCPs)
as well, with an appropriate integer-capable solver.</p>
<p>To use CVX effectively, you need to know at least a bit about convex
optimization. For background on convex optimization, see the book
<a class="reference external" href="http://www.stanford.edu/~boyd/cvxbook">Convex Optimization</a> <a class="reference internal" href="credits.html#bv04" id="id2">[BV04]</a> or the
<a class="reference external" href="http://www.stanford.edu/class/ee364a">Stanford course EE364A</a>.</p>
<p>CVX is implemented in <a class="reference external" href="http://mathworks.com">Matlab</a>, effectively
turning Matlab into an optimization modeling language. Model
specifications are constructed using common Matlab operations and
functions, and standard Matlab code can be freely mixed with these
specifications. This combination makes it simple to perform the
calculations needed to form optimization problems, or to process the
results obtained from their solution. For example, it is easy to compute
an optimal trade-off curve by forming and solving a family of
optimization problems by varying the constraints. As another example,
CVX can be used as a component of a larger system that uses convex
optimization, such as a branch and bound method, or an engineering
design framework.</p>
<p id="index-2">CVX provides special modes to simplify the construction of problems
from two specific problem classes. In
<a class="reference internal" href="sdp.html#sdp-mode"><em>semidefinite programming (SDP) mode</em></a>,
CVX applies a matrix interpretation to the
inequality operator, so that linear matrix inequalities (LMIs) and
SDPs may be expressed in a more natural form. In
<a class="reference internal" href="gp.html#gp-mode"><em>geometric programming (GP) mode</em></a>,
CVX accepts all of the special functions and
combination rules of geometric programming, including monomials,
posynomials, and generalized posynomials, and transforms such problems
into convex form so that they can be solved efficiently. For background
on geometric programming, see this
<a class="reference external" href="http://www.stanford.edu/~boyd/papers/gp_tutorial.html">tutorial paper</a> <a class="reference internal" href="credits.html#bkvh05" id="id3">[BKVH05]</a>.</p>
<span class="target" id="index-3"></span><p id="index-4">Previous versions of CVX supported two free SQLP solvers,
<a class="reference external" href="http://sedumi.ie.lehigh.edu">SeDuMi</a> <a class="reference internal" href="credits.html#stu99" id="id4">[Stu99]</a> and
<a class="reference external" href="http://www.math.nus.edu.sg/~mattohkc/sdpt3.html">SDPT3</a> <a class="reference internal" href="credits.html#ttt03" id="id5">[TTT03]</a>. These
solvers are included with the CVX distribution. Starting with version 2.0,
CVX supports two <em>commercial</em> solvers as well,
<a class="reference external" href="http://gurobi.com">Gurobi</a> and <a class="reference external" href="http://mosek.com">MOSEK</a>. For
more information, see <a class="reference internal" href="solver.html#solvers"><em>Solvers</em></a>.</p>
<p>The ability
to use CVX with commercial solvers is a new capability that we have decided
to include under a new CVX Professional license model. Academic users will
be able to utilize these features at no charge, but commercial users will require
a paid CVX Professional license. For more details, see <a class="reference internal" href="#licensing"><em>Licensing</em></a>.</p>
<div class="section" id="what-s-new">
<h3>What&#8217;s new?<a class="headerlink" href="#what-s-new" title="Permalink to this headline">¶</a></h3>
<p>If you browse the source code and documentation,
you will find indications of support for Octave with CVX. However:</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Unfortunately, for average end users (this means you!), Octave
will <em>not</em> work. The <em>currently released</em> versions of Octave,
including versions 3.8.0 and earlier, do not
support CVX. Please do not waste your time by trying!</p>
</div>
<p>We are working hard with the Octave team on final updates
to bring CVX to Octave, and we anticipate version 3.8.1 or 3.9.0 will
be ready. We add this here to warn you <em>not</em> to interpret the mentions
of Octave in the code as a hidden code to try it yourself!</p>
</div>
</div>
<div class="section" id="what-is-disciplined-convex-programming">
<span id="what-is-dcp"></span><span id="index-5"></span><h2>What is disciplined convex programming?<a class="headerlink" href="#what-is-disciplined-convex-programming" title="Permalink to this headline">¶</a></h2>
<p><em>Disciplined convex programming</em> is a methodology for constructing
convex optimization problems proposed by
Michael Grant, Stephen Boyd, and Yinyu Ye <a class="reference internal" href="credits.html#gby06" id="id6">[GBY06]</a>, <a class="reference internal" href="credits.html#gra04" id="id7">[Gra04]</a>.
It is meant to support the formulation and construction of optimization
problems that the user intends <em>from the outset</em> to be convex.</p>
<p id="index-6">Disciplined convex programming
imposes a set of conventions or rules, which we call <a class="reference internal" href="dcp.html#dcp"><em>the DCP ruleset</em></a>.
Problems which adhere to the ruleset can be rapidly and automatically
verified as convex and converted to solvable form. Problems that violate
the ruleset are rejected&#8212;even when the problem is convex. That is not
to say that such problems cannot be solved using DCP; they just need to
be rewritten in a way that conforms to the DCP ruleset.</p>
<p>A detailed description of the DCP ruleset is given in <a class="reference internal" href="dcp.html#dcp"><em>The DCP ruleset</em></a>.
It is extremely important for anyone who intends to
actively use CVX to understand it. The ruleset is simple to learn, and
is drawn from basic principles of convex analysis. In return for
accepting the restrictions imposed by the ruleset, we obtain
considerable benefits, such as automatic conversion of problems to
solvable form, and full support for nondifferentiable functions. In
practice, we have found that disciplined convex programs closely
resemble their natural mathematical forms.</p>
<div class="section" id="mixed-integer-problems">
<span id="what-is-midcp"></span><span id="index-7"></span><h3>Mixed integer problems<a class="headerlink" href="#mixed-integer-problems" title="Permalink to this headline">¶</a></h3>
<p>With version 2.0, CVX now supports <em>mixed integer</em> disciplined convex programs (MIDCPs).
A MIDCP is a model that obeys the same convexity rules as standard DCPs, except
that one or more of its variables is constrained to take on integral values. In other
words, if the integer constraints are removed, the result is a standard DCP.</p>
<p>Unlike a true DCP, a mixed integer problem is <em>not</em> convex. Finding the global optimum
requires the combination of a traditional convex optimization algorithm with an exhaustive
search such as a branch-and-bound algorithm. Some CVX solvers do not include this second
piece and therefore do not support MIDCPs; see <a class="reference internal" href="solver.html#solvers"><em>Solvers</em></a> for more information.
What is more, even the best solvers cannot
guarantee that every moderately-sized MIDCP can be solved in a reasonable amount of time.</p>
<p>Mixed integer disciplined convex programming represents new territory for the
CVX modeling framework&#8212;and for the supporting solvers as well. While solvers
for mixed integer linear and quadratic programs (MILP/MIQP) are reasonably mature,
support for more general convex nonlinearities is a relatively new
development. We anticipate that MIDCP support will improve over time.</p>
</div>
</div>
<div class="section" id="what-cvx-is-not">
<h2>What CVX is <em>not</em><a class="headerlink" href="#what-cvx-is-not" title="Permalink to this headline">¶</a></h2>
<p>CVX is <em>not</em> meant to be a tool for checking if your problem is convex.
You need to know a bit about convex optimization to effectively use CVX;
otherwise you are the proverbial monkey at the typewriter, hoping to
(accidentally) type in a valid disciplined convex program. If you are
not certain that your problem is convex <em>before</em> you enter it into CVX,
you are using the tool improperly, and your efforts will likely fail.</p>
<p>CVX is <em>not</em> meant for very large problems, so if your problem is very
large (for example, a large image processing or machine learning problem), CVX is unlikely
to work well (or at all). For such problems you will likely need to
directly call a solver, or to develop your own methods, to get the
efficiency you need.</p>
<p>For such problems CVX can play an important role, however. Before
starting to develop a specialized large-scale method, you can use CVX to
solve scaled-down or simplified versions of the problem, to rapidly
experiment with exactly what problem you want to solve. For image
reconstruction, for example, you might use CVX to experiment with
different problem formulations on <span class="math">\(50 \times 50\)</span> pixel images.</p>
<p>CVX <em>will</em> solve many medium and large scale problems, provided they
have exploitable structure (such as sparsity), and you avoid <tt class="docutils literal"><span class="pre">for</span></tt>
loops, which can be slow in Matlab, and functions like <tt class="docutils literal"><span class="pre">log</span></tt> and <tt class="docutils literal"><span class="pre">exp</span></tt> that
require successive approximation. If you encounter difficulties in
solving large problem instances, consider posting your model to the
<a class="reference external" href="http://ask.cvxr.com">CVX Forum</a>; the CVX community
may be able to suggest an equivalent formulation that CVX
can process more efficiently.</p>
</div>
<div class="section" id="licensing">
<span id="index-8"></span><span id="id8"></span><h2>Licensing<a class="headerlink" href="#licensing" title="Permalink to this headline">¶</a></h2>
<p>CVX is free for use in both academic and commercial settings when paired with
a free solver&#8212;including the versions of SeDuMi and SDPT3 that are included with the
package.</p>
<p>With version 2.0, we have added the ability to connect CVX to <em>commercial</em> solvers as well.
This new functionality is released under a <em>CVX Professional</em> product tier
which we intend to license to commercial users for a fee, and offer to academic users
at no charge. The licensing structure is as follows:</p>
<ul class="simple">
<li><em>All users</em> are free to use the standard features of CVX <em>at no charge</em>.
This includes the ability to construct and solve any of the models
supported by the free solvers SeDuMi and SDPT3.</li>
<li><em>Commercial users</em> who wish to solve CVX models using Gurobi or MOSEK will
need to purchase a CVX Professional license. Please send an email to
<a class="reference external" href="mailto:sales&#37;&#52;&#48;cvxr&#46;com">CVX Research</a> for inquiries.
for an availability schedule and pricing details.</li>
<li><em>Academic users</em> may utilize the CVX Professional capability <em>at no charge</em>.
To obtain an academic license, please visit the
<a class="reference external" href="http://cvxr.com/cvx/academic">Academic licenses</a> page on the
CVX Research web site.</li>
</ul>
<p>The bulk of CVX remains open source under a slightly modified version of the GPL Version
2 license. A small number of files that support the CVX Professional functionality remain
closed source. If those files are removed, the modified package remains <em>fully functional</em>
using the free solvers, SeDuMi and SDPT3. Users
may freely modify, augment, and redistribute this free version of CVX, as long as all
modifications are themselves released under the same license. This includes adding support
for new solvers released under a free software license such as the GPL.
For more details, please see the full <a class="reference internal" href="license.html#licensing2"><em>Licensing</em></a> section.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
        <p class="logo"><a href="index.html" title="index">
          <img class="logo" src="_static/cvxrlogo.png" alt="Logo"/>
        </a></p><div class="sphinxlocaltoc">
    <h3><a href="index.html">Page contents</a></h3>
    <ul>
<li><a class="reference internal" href="#">Introduction</a><ul>
<li><a class="reference internal" href="#what-is-cvx">What is CVX?</a><ul>
<li><a class="reference internal" href="#what-s-new">What&#8217;s new?</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-is-disciplined-convex-programming">What is disciplined convex programming?</a><ul>
<li><a class="reference internal" href="#mixed-integer-problems">Mixed integer problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#what-cvx-is-not">What CVX is <em>not</em></a></li>
<li><a class="reference internal" href="#licensing">Licensing</a></li>
</ul>
</li>
</ul>

  </div>
  <div class="sphinxprev">
    <h4>Previous page</h4>
    <p class="topless"><a href="index.html"
                          title="Previous page">&larr; CVX Users&#8217; Guide</a></p>
  </div>
  <div class="sphinxnext">
    <h4>Next page</h4>
    <p class="topless"><a href="install.html"
                          title="Next page">&rarr; Installation</a></p>
  </div>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="_sources/intro.txt"
           rel="nofollow">Show Source</a></li>
  </ul><h3>Other links</h3>
<ul class="this-page-menu">
<li><a href="CVX.pdf" target="_blank">Download the PDF</a></li>
<li><a href="http://cvxr.com/cvx">CVX home page</a></li>
</ul>


<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="relbar-bottom">
        
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="install.html" title="Installation"
             >next</a> &nbsp; &nbsp;</li>
        <li class="right" >
          <a href="index.html" title="CVX Users’ Guide"
             >previous</a> &nbsp; &nbsp;</li>
    <li><a href="index.html">CVX Users&#39; Guide</a> &raquo;</li>
 
      </ul>
    </div>
    </div>

    <div class="footer">
        &copy; Copyright © 2012, CVX Research, Inc..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.1.
    </div>
    <!-- cloud_sptheme 1.4 -->
  </body>
</html>